package jdesktop.appbar;

public interface AppBarModel extends PropertyChangeSource
{
    /**
     * The edge that the app bar occupies. When positioned along an edge, the primary axis of the
     * appbar occupies as much of the screen along that axis as possible. E.g. if the app bar is
     * horizontal, then it will occupy as much of the width of the screen as possible.
     * The default value is the first edge that is allowed by the {@link #ALLOWEDEDGES} property.
     */
    String EDGE = "edge";
    /**
     * A {@link jdesktop.appbar.Sides} instance that defines the edges that this appbar is allowed to
     * occupy. If the appbar can be dragged, it can only be dragged to an allowed edge.
     * By default, all edges are allowed.
     */
    String ALLOWEDEDGES = "allowedEdges";

    /**
     * The window state can be restored to how it was before registering with the appbar
     * when the appbar is unregistered. When {@code true}, the window state (size, visibility,
     * and window styles) are stored at registration time, and restored when the window
     * is unregistered.
     * Default value is {@vale #DEFAULT_RESTORESTATE}.
     */
    String RESTORESTATE = "restoreState";
    boolean DEFAULT_RESTORESTATE = false;
    // todo - this can be managed by the client, or by a helper class.
    // move out of the main UI code.

    /**
     * The current size of the appbar. This is the number of pixels from the inner edge to the outer edge
     * of the appbar's client area. It does not include the size of the insets. Hence, setting size to 0
     * produces a window where just the decoration is visible.
     * Default value is {@value #DEFAULT_BARSIZE}.
     * @see #getBarSize(), #setBarSize(int)
     */
    String BARSIZE = "barSize";
    int DEFAULT_BARSIZE = 36;
    /**
     * The explicitly set, desired size of the toolbar.
     * @see #setDesiredBarSize(int)
     */
    String DESIREDBARSIZE = "desiredBarSize";
    /**
     * The docked state of this appbar. When {@code true} the appbar is docked, reserving a portion
     * of the desktop, and offsetting all maximized windows. When {@code false} no desktop area is reserved, and
     * the window styles are returned to the valeus they were before the appbar was registered.
     * The default value is {@code true}.
     */
    String DOCKED = "docked";



    /**
     * Can the window be floated back onto the desktop.
     * In other words, can the {@link #DOCKED} property be changed to {@code false}.
     */
    String FLOATABLE = "floatable";


    Edge getEdge();

    void setEdge(Edge edge);

    Sides getAllowedEdges();

    int getBarSize();

    void setBarSize(int barSize);

    int getDesiredBarSize();

    void setDesiredBarSize(int desiredBarSize);

    /**
     * Sets the amount of autohide.
     * @param amount 0.0 means that all of the requested bar size
     * is visible. 1.0 means none of the bar is visible (apart from drag handles etc...).
     */
    void setAutoHideAmount(double amount);
    double getAutoHideAmount();

    /**
     *
     * @return
     * @see #FLOATABLE
     */
    boolean isFloatable();

    boolean isDocked();

    // todo - replace with setFloating
    void setDocked(boolean docked);

    /**
     * @param floating
     */
    void setFloating(boolean floating);



    /**
     * Can the window be resized?
     */
    String RESIZABLE = "resiable";

    boolean isResizable();

    /**
     * Used to group multiple property changes into a single logical change.
     * @param b
     * @return
     */
    boolean setFreezeNotification(boolean b);

    void setFloatingLocation(int x, int y);
    void setFloatingSize(int width, int height);
}
